package com.ifcar.app.activity.tab;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.ifcar.app.activity.FeedBackActivity;
import com.ifcar.app.activity.R;
import com.ifcar.app.activity.SettingsActivity;
import com.ifcar.app.fragment.NRFragment;

public class MoreFragment extends NRFragment{
 
    private Context mContext;
    private Button setting;
    private Button feedback;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
    }
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        mContext = getActivity();
        return inflater.inflate(R.layout.tab_more, null);
    }
    
    @Override
    public void onViewCreatedNR(View view, Bundle savedInstanceState) {
        super.onViewCreatedNR(view, savedInstanceState);
        setting = (Button)view.findViewById(R.id.setting);
        feedback = (Button)view.findViewById(R.id.feedback);
        setListener();
        
    }
    
    private void setListener(){
        
        setting.setOnClickListener(new View.OnClickListener() {
            
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(mContext,SettingsActivity.class);
                mContext.startActivity(intent);
            }
        });
        
        feedback.setOnClickListener(new View.OnClickListener() {
            
            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                Intent intent = new Intent(mContext,FeedBackActivity.class);
                mContext.startActivity(intent);
            }
        });
    }
}
